cmake_minimum_required(VERSION 3.0.2)
project(crack_detect)


find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
)


find_package(Boost COMPONENTS system filesystem program_options REQUIRED)
find_package(OpenCV REQUIRED)


catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES crack_detect
#  CATKIN_DEPENDS roscpp rospy
#  DEPENDS system_lib
)

include_directories(
        ${OpenCV_INCLUDE_DIRS}
        ${EIGEN_INCLUDE_DIRS}
        /opt/ros/melodic/include/cv_bridge
        ${PROJECT_SOURCE_DIR}/include/crack_detect)
include_directories(/home/g/yolo3/yolo_crack/src/crack_detect/include/crack_detect)
set(CMAKE_CXX_STANDARD 14)


include_directories(
# include
  ${catkin_INCLUDE_DIRS}
)

add_library(Detecting
    SHARED
    src/Detecting.cpp
    #src/picture2string.cpp
    #src/main.cpp 
)

target_link_libraries(Detecting
        ${Boost_LIBRARIES}
        ${OpenCV_LIBS}
        /opt/ros/melodic/lib/libcv_bridge.so
        ${PROJECT_SOURCE_DIR}/lib/libdarknet.so)

add_library(image_cutting_together
    SHARED
    src/image_cutting_together.cpp
    #src/picture2string.cpp
    #src/main.cpp 
)

target_link_libraries(image_cutting_together
        ${Boost_LIBRARIES}
        ${OpenCV_LIBS}
        /opt/ros/melodic/lib/libcv_bridge.so
        ${PROJECT_SOURCE_DIR}/lib/libdarknet.so)

add_library(line_detect
    SHARED
    src/line_detect.cpp
)

target_link_libraries(line_detect
        ${Boost_LIBRARIES}
        ${OpenCV_LIBS}
        /opt/ros/melodic/lib/libcv_bridge.so
        ${PROJECT_SOURCE_DIR}/lib/libdarknet.so)

add_library(detect_loop
    SHARED
    src/detect_loop.cpp
)


target_link_libraries(detect_loop
        ${Boost_LIBRARIES}
        ${OpenCV_LIBS}
        /opt/ros/melodic/lib/libcv_bridge.so
        ${PROJECT_SOURCE_DIR}/lib/libdarknet.so)

add_executable(detect
        src/main.cpp
        src/Detecting.cpp
        src/image_cutting_together.cpp
        src/line_detect.cpp
        src/detect_loop.cpp
        src/pretreatment.cpp
        #src/Detecting.h
        #src/DetectResult.h
)

target_link_libraries(detect
        ${Boost_LIBRARIES}
        ${OpenCV_LIBS}
        /opt/ros/melodic/lib/libcv_bridge.so
        ${PROJECT_SOURCE_DIR}/lib/libdarknet.so)
